package org.nashua.tt151;

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.Joystick;

public class AnalogInput extends SimpleRobot {
    public AnalogChannel pot = new AnalogChannel(RobotMap.Potentiometer.POT1);
    public Joystick joy = new Joystick(1);
    public void robotInit() {
        pot.initAccumulator();
    }
    public void operatorControl() {
        while (isEnabled() && isOperatorControl()) {
            if (joy.getRawButton(RobotMap.DualAction.Button.A))
                System.out.println("Raw Value: "+pot.getValue());
            if (joy.getRawButton(RobotMap.DualAction.Button.B))
                System.out.println("Average Value: "+pot.getAverageValue());
            if (joy.getRawButton(RobotMap.DualAction.Button.X))
                System.out.println("Accumulative Value: "+pot.getAccumulatorValue());
            if (joy.getRawButton(RobotMap.DualAction.Button.Y)) {
                pot.resetAccumulator();
                System.out.println("Reset Acculator");
            }
        }
    }
}
